;;; init.el --- Emacs init file -*- lexical-binding: t -*-
;;; Commentary:

;; compile Emacs from source:
;;   ./configure --prefix=/usr/local/emacs --with-dbus --with-gnutls --with-rsvg  --with-mailutils --with-xml2 --with-modules --with-x-toolkit=gtk3 --disable-gc-mark-trace

;;; Code:

(let ((file-name-handler-alist nil))
  ;; Put custom-set-variables in custom.el
  (setq custom-file (expand-file-name "custom.el" user-emacs-directory))

  ;; Personal configure
  (add-to-list 'load-path (expand-file-name "lisp" user-emacs-directory))

  ;; Measure startup time
  (require 'init-benchmarking)

  ;; Loading configuration
  (require 'init-utils)
  (require 'init-base-config)
  (require 'init-site-lisp)
  (require 'init-theme)
  (require 'init-packages)
  (require 'init-minibuffer)
  (require 'init-isearch)
  (require 'init-editing-utils)
  (require 'init-window)
  (require 'init-evil)
  (require 'init-project)
  (require 'init-ibuffer)
  (require 'init-ediff)
  (require 'init-dired)
  (require 'init-eshell)
  (require 'init-org)
  (require 'init-markdown)
  (require 'init-which-key)
  (require 'init-yasnippet)
  (require 'init-magit)
  (require 'init-completion)
  (require 'init-lsp)
  (require 'init-lsp-bridge)
  (require 'init-treemacs)
  (require 'init-c)
  (require 'init-python)
  (require 'init-java)
  (require 'init-go)
  (require 'init-rust)
  (require 'init-web)
  (require 'init-lua)
  (require 'init-xml)
  (require 'init-docker)
  (require 'init-flycheck)
  (require 'init-input-method)
  (require 'init-treesit)
  (require 'init-structedit)
  (require 'init-langtool)
  (require 'init-translate)
  (require 'init-popweb)
  (require 'init-pdf-tools)
  (require 'init-ebook)
  (require 'init-rss)
  (require 'init-vterm)
  (require 'init-eaf)
  (require 'init-misc)

  ;; Loading custom.el
  (load custom-file nil t)

  ;; Set `gc-cons-threshold' and `gc-cons-percentage' when all set
  (add-hook 'emacs-startup-hook (lambda () (setq gc-cons-threshold (* 100 1024 1024)
                                                 gc-cons-percentage 0.15))))
;;; init.el ends here
